from django.shortcuts import render_to_response
from django.http import Http404, HttpResponseRedirect
from utils.urlresolvers import locreverse

from myapps.polls import models

def results(request, poll_id):
    poll_id = int(poll_id) 
    
    poll = models.Poll.get_by_id(poll_id)
    if poll is None:
        raise Http404
    
    return render_to_response('polls/results.html', {'poll': poll})